import { BrowserRouter as Router, Link, Route, Routes } from "react-router-dom";
import { Suspense } from "react";
import "./App.css";
import Home from "./pages/Home";
import About from "./pages/About";

function App() {
  return (
    <div className="App">
      <Router basename={window.__POWERED_BY_QIANKUN__ ? "/app-react" : "/"}>
        <nav className="app-nav">
          <Link to="/">Home</Link>&nbsp;|&nbsp;
          <Link to="/about">About</Link>
        </nav>
        <Suspense fallback={null}>
          <Routes>
            <Route path="/" exact element={<Home/>} />
            <Route path="/about" element={<About/>} />
          </Routes>
        </Suspense>
      </Router>
    </div>
  );
}

export default App;
